package org.jackysoft.entity;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(
		name="os_wftoken",
		uniqueConstraints={
			@UniqueConstraint(
			    columnNames={"parentToken"}
		    )
		}
)
public class OsWorkflowToken implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3936683089086458832L;

	private Integer actionId;
	private String actionName;
	private Calendar endTime;
	private String id;
	private OsWorkflowToken parent;
	private String signaler;
	private String signalerLocal;
	private Calendar startTime;
	private Integer stepId;
	private String stepName;
	private boolean root;
	
	
	public Integer getActionId() {
		return actionId;
	}
	public String getActionName() {
		return actionName;
	}
	public Calendar getEndTime() {
		return endTime;
	}
	
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getId() {
		return id;
	}
	
	@ManyToOne
	@JoinColumn(name="parentToken")
	public OsWorkflowToken getParent() {
		return parent;
	}
	public String getSignaler() {
		return signaler;
	}
	public String getSignalerLocal() {
		return signalerLocal;
	}
	public Calendar getStartTime() {
		return startTime;
	}
	public Integer getStepId() {
		return stepId;
	}
	public String getStepName() {
		return stepName;
	}
	
	public void setActionId(Integer actionId) {
		this.actionId = actionId;
	}
	public void setActionName(String actionName) {
		this.actionName = actionName;
	}
	public void setEndTime(Calendar endTime) {
		this.endTime = endTime;
	}
	public void setId(String id) {
		this.id = id;
	}
	public void setParent(OsWorkflowToken parent) {
		this.parent = parent;
	}
	public void setSignaler(String signaler) {
		this.signaler = signaler;
	}
	public void setSignalerLocal(String signalerLocal) {
		this.signalerLocal = signalerLocal;
	}
	public void setStartTime(Calendar startTime) {
		this.startTime = startTime;
	}
	public void setStepId(Integer stepId) {
		this.stepId = stepId;
	}
	public void setStepName(String stepName) {
		this.stepName = stepName;
	}
	public boolean isRoot() {
		return root;
	}
	public void setRoot(boolean root) {
		this.root = root;
	}	
	
}
